package JDBC;
//mysql-connector-java-5.1.37-bin.jar

import com.mysql.jdbc.Driver;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class jdbcDemo01 {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {

Class.forName("com.mysql.jdbc.Driver");
//获取数据库连接对象
        Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb", "root", "123");
        String sql="update employee set Salary = 8888888888888888888 where Eid=0010";

        //获取执行sql的执行语句
        Statement stmt = conn.createStatement();
        int count = stmt.executeUpdate(sql);
        //处理结果
        System.out.println(count);
        //释放资源
        stmt.close();
        conn.close();
    }
}
